package com.lagou.json;

import com.alibaba.fastjson.JSON;

/**
 * @description:
 * @author: 任嘉豪
 * @version: V1.0
 * @date: 20-6-7 下午12:37
 **/
public class JSONSerializer implements Serializer{


    @Override

    public byte[] serialize(Object object) {

        return JSON.toJSONBytes(object);

    }



    @Override

    public <T> T deserialize(Class<T> clazz, byte[] bytes) {

        return JSON.parseObject(bytes, clazz);

    }
}
